package daily.may0528;

class TicketWindow extends Thread {
    int tickets = 10;//共10张票
    @Override
    public void run() {
        while(tickets>0) {
            System.out.printf("%s窗口第%d张票已经售出\n", Thread.currentThread().getName(), tickets--);
        }
    }
}

public class TicketThreadTest {
    public static void main(String[] args) {
        new TicketWindow().start();
        new TicketWindow().start();
        new TicketWindow().start();
        new TicketWindow().start();
    }
}
